package com.cxso.example.request.report;

import com.cxso.example.enums.report.InvoiceStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class ReportInvoiceRequest implements Serializable {

    @NotBlank
    @Schema(description = "主体id")
    private String bodyId;

    @Valid
    @Schema(description = "发票信息")
    @NotEmpty(message = "运单号不能为空")
    private List<Invoice> invoiceList;


    @Getter
    @Setter
    public static class Invoice {

        @Schema(description = "运单号")
        @NotEmpty(message = "运单号不能为空")
        private List<String> shippingNoteNumbers;

        @Schema(description = "发票号码")
        @NotBlank(message = "发票号码不能为空")
        private String invoiceNumber;

        @Schema(description = "发票代码号")
        @NotBlank(message = "发票代码号不能为空")
        private String invoiceCode;

        @Schema(description = "发票金额")
        @NotNull(message = "发票金额不能为空")
        private BigDecimal invoiceAmount;

        @Schema(description = "开票日期")
        private Date invoiceDateTime;

        @Schema(description = "销售方名称")
        private String sellerName;

        @Schema(description = "销售方纳税人识别号")
        private String sellerTaxpayerIdentificationNumber;

        @Schema(description = "销售方地址")
        private String sellerAddress;

        @Schema(description = "销售方电话")
        private String sellerTelephone;

        @Schema(description = "销售方开户行")
        private String sellerBankName;

        @Schema(description = "销售方银行账号")
        private String sellerBankAccount;

        @Schema(description = "受票方")
        private String buyerName;

        @Schema(description = "受票方纳税人识别号")
        private String buyerTaxpayerIdentificationNumber;

        @Schema(description = "受票方地址")
        private String buyerAddress;

        @Schema(description = "受票方电话")
        private String buyerTelephone;

        @Schema(description = "受票方银行")
        private String buyerBankName;

        @Schema(description = "受票方银行账号")
        private String buyerBankAccount;

        @Schema(description = "货主发票文件")
        private String invoiceUrl;

        @Schema(description = "发票状态")
        private InvoiceStatusEnum invoiceStatus;

        @Schema(description = "作废备注")
        private String cancelRemark;

        @Schema(description = "作废文件")
        private String cancelUrl;

        @Schema(description = "作废时间")
        private Date cancelTime;
    }

}
